﻿using HttpClientFactoryLearning.RestService;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace HttpClientFactoryLearning.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class HelloRefitController : ControllerBase
    {
        private readonly IHelloClient _client;

        public HelloRefitController(IHelloClient client)
        {
            _client = client;
        }

        [HttpGet("/")]
        public async Task<ActionResult<Reply>> Index()
        {
            return await _client.GetMessageAsync();
        }
    }
}